package com.example.vote.controller;

import com.example.vote.model.Player;
import com.example.vote.service.PlayerService;
import com.example.vote.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * ClassName: PlayerController
 * Package: com.example.vote.controller
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-06-26
 * Time: 10:05
 */
@RestController
@RequestMapping("/player")
public class PlayerController {

    //选手信息
    @Autowired
    private PlayerService playerService;

    @GetMapping("/find")
    public Result<List<Player>> find(){

        List<Player> list = playerService.list();

        return new Result<>(1,"查询成功",list);
    }

    //投票功能
    @PostMapping("/vote")
    public Result vote(@RequestParam("id[]") List<Integer> id){
        System.out.println(id);

        return null;

    }



}
